<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  
  <title>程序猜想</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="成长就是不断骂过去的自己傻逼,一路认可过去的自己过去的选择">
<meta property="og:type" content="website">
<meta property="og:title" content="程序猜想">
<meta property="og:url" content="https://blog.520wa.com/page/3/index.html">
<meta property="og:site_name" content="程序猜想">
<meta property="og:description" content="成长就是不断骂过去的自己傻逼,一路认可过去的自己过去的选择">
<meta property="og:locale" content="zh-Hans">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="程序猜想">
<meta name="twitter:description" content="成长就是不断骂过去的自己傻逼,一路认可过去的自己过去的选择">
  
  
    <link rel="icon" href="/css/images/qrcode4assert1024.jpg">
  
  <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="/css/style.css">
  

  <script>
  var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?e666d013b82854116bc37c32dd2f43e3";
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(hm, s);
})();
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
  </script>
</head>
</html>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">程序猜想</a>
      </h1>
      
        <h2 id="subtitle-wrap">
          <a href="/" id="subtitle">写Java EE的Android程序员</a>
        </h2>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
          <a class="main-nav-link" href="/about">About</a>
        
      </nav>
      <nav id="sub-nav">
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="https://blog.520wa.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main">
  
    <article id="post-statistics-learn1-average" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2018/02/05/statistics-learn1-average/" class="article-date">
  <time datetime="2018-02-05T06:53:13.000Z" itemprop="datePublished">2018-02-05</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/统计学/">统计学</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2018/02/05/statistics-learn1-average/">统计学第一篇，均值、中位数、众数</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>均值、中位数、众数是表示一组数据集中趋势的量数，下面以“1,2,3,3,5,7,7,8,9,10”数据集为例</p>
<p>均值,中位数,众数  </p>
<table>
<thead>
<tr>
<th>Type</th>
<th>示例</th>
<th>值</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>均值(Mean)</td>
<td>(1+2+3+3+5+7+7+8+9+10)/10</td>
<td>5.5</td>
<td>算术平均数。求和，再除个数</td>
</tr>
<tr>
<td>中位数(Median)</td>
<td>(5+7)/2</td>
<td>6</td>
<td>选取平均数。从小到大排序;选取中间的数求算术平均数</td>
</tr>
<tr>
<td>众数(Mode)</td>
<td>3,7</td>
<td>3,7</td>
<td>数据集中出现次数最多的数</td>
</tr>
</tbody>
</table>
<h6 id="众数，有多个数出现的次数最多，则它们都是众数"><a href="#众数，有多个数出现的次数最多，则它们都是众数" class="headerlink" title="众数，有多个数出现的次数最多，则它们都是众数"></a>众数，有多个数出现的次数最多，则它们都是众数</h6><p><a href="2018/01/27/data-analysis-house-price/">使用Java、Excel数据分析如何有效投资房产</a>中在自己实际投资分析中，应该将房价清洗为以千或500为单位后用众数及中位数进行分析更为合理，否则异常值会误导分析</p>
<h6 id="转载请标明出处："><a href="#转载请标明出处：" class="headerlink" title="转载请标明出处："></a>转载请标明出处：</h6><h6 id="http-2tu-github-io-2018-02-05-statistics-learn1-average"><a href="#http-2tu-github-io-2018-02-05-statistics-learn1-average" class="headerlink" title="http://2tu.github.io/2018/02/05/statistics-learn1-average/"></a><a href="http://2tu.github.io/2018/02/05/statistics-learn1-average/" target="_blank" rel="noopener">http://2tu.github.io/2018/02/05/statistics-learn1-average/</a></h6><h6 id="本文出自Tu’s-blog"><a href="#本文出自Tu’s-blog" class="headerlink" title="本文出自Tu’s blog"></a>本文出自Tu’s blog</h6>
      
    </div>
    <footer class="article-footer">
      <a data-url="https://blog.520wa.com/2018/02/05/statistics-learn1-average/" data-id="ckcqflawi0010eodehx5s8m0v" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/中位数/">中位数</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/众数/">众数</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/均值/">均值</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-data-decision-go-home-time-in-the-spring-festival" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2018/01/29/data-decision-go-home-time-in-the-spring-festival/" class="article-date">
  <time datetime="2018-01-29T05:45:01.000Z" itemprop="datePublished">2018-01-29</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/数据/">数据</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2018/01/29/data-decision-go-home-time-in-the-spring-festival/">基于数据决策春节怎样回家最不堵车</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h6 id="互联网从业者的优势在于会查看利用网络上公开数据"><a href="#互联网从业者的优势在于会查看利用网络上公开数据" class="headerlink" title="互联网从业者的优势在于会查看利用网络上公开数据"></a>互联网从业者的优势在于会查看利用网络上公开数据</h6><p>还有14个工作日就过年了，各大公司即将封版，很多已无心工作数着日子等过年（作者除外，还有两个版本需上线）。 数日子过年的时候不得不谋划如何休假使假期时间最长，可惜今年是前4后3，没那么好。<br>今年过年得回我家、老婆家，分别为200公里-3小时、450公里-6小时左右。堵在路上听着儿子撕心裂肺的哭声犹如应用宕掉了一样让人着急心疼。除了每过一个服务区重新导航一次以外还能做些什么避免呢？年底时各大地图、打车软件发布过各互联网公司加班情况，那他们是否也有春节的交通预测呢？答案是有的。<br>
        
          <p class="article-more-link">
            <a href="/2018/01/29/data-decision-go-home-time-in-the-spring-festival/#more">Read More</a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://blog.520wa.com/2018/01/29/data-decision-go-home-time-in-the-spring-festival/" data-id="ckcqflaw1000jeoded0l1mpjt" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/数据决策/">数据决策</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/春运交通情况/">春运交通情况</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-data-analysis-house-price" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2018/01/27/data-analysis-house-price/" class="article-date">
  <time datetime="2018-01-27T13:47:06.000Z" itemprop="datePublished">2018-01-27</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/数据/">数据</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2018/01/27/data-analysis-house-price/">使用Java、Excel数据分析如何有效投资房产</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h4 id="写在前面的话"><a href="#写在前面的话" class="headerlink" title="写在前面的话"></a>写在前面的话</h4><p>2017年IT业中多起猝死、自杀，创业的九死一生，各大公司清算、裁员等。年底也总是充斥着各种活动刷屏，年终总结、账单等。30岁的程序猿什么的，不幸我们可能也是其中之一。要改变现状，离不开钱与投资，提到投资就不得不提房。过去数十年的房价颠覆了努力工作改变生活的思维。作为程序猿比他人多的优势在于可以利用互联网数据进行数据分析决策，接下来看看<font color="red">基于链家中重庆渝北区人和二手房及国家全国商品房销售面积统计的简单数据分析</font>。<br>
        
          <p class="article-more-link">
            <a href="/2018/01/27/data-analysis-house-price/#more">Read More</a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://blog.520wa.com/2018/01/27/data-analysis-house-price/" data-id="ckcqflaw0000ieodecmnldltk" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Excel/">Excel</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Java数据分析房价/">Java数据分析房价</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/数据分析/">数据分析</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-NODE-ENV-cross" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2018/01/18/NODE-ENV-cross/" class="article-date">
  <time datetime="2018-01-18T14:13:30.000Z" itemprop="datePublished">2018-01-18</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/其它/">其它</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2018/01/18/NODE-ENV-cross/">NODE_ENV跨平台设置</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h5 id="set-NODE-ENV问题"><a href="#set-NODE-ENV问题" class="headerlink" title="set NODE_ENV问题"></a>set NODE_ENV问题</h5><p>最近接手系统中采用React作为管理端，其中有这样一句</p>
<figure class="highlight 1c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"build"</span>: <span class="string">"node ./tools/gulpfile.js&amp;&amp;set NODE_ENV=__PROD__&amp;&amp;node ./tools/webpack.config.js"</span></span><br></pre></td></tr></table></figure>
<p>其中“set NODE_ENV=<strong>PROD</strong>”却未在我的Mac下生效，其他成员使用Windows。<br>原因是Windows下使用set NODE_ENV=xx，Unix下应该为export NODE_ENV=xx，于是不得不区分操作系统进行设置，于是就有了<a href="https://github.com/kentcdodds/cross-env" target="_blank" rel="noopener">cross-env</a>这个方案。<br>
        
          <p class="article-more-link">
            <a href="/2018/01/18/NODE-ENV-cross/#more">Read More</a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://blog.520wa.com/2018/01/18/NODE-ENV-cross/" data-id="ckcqflavg0005eodesathjdiv" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/NODE-ENV/">NODE_ENV</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/cross-env/">cross-env</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/spawn/">spawn</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-spring-bean-scope" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2018/01/12/spring-bean-scope/" class="article-date">
  <time datetime="2018-01-12T14:39:39.000Z" itemprop="datePublished">2018-01-12</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java/">Java</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2018/01/12/spring-bean-scope/">Spring中Bean的作用域与StepScope关系、疑问</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>Spring Bean有5个作用域，但是最近有需求在多个地方获取同一个Bean，只修改其中一个参数。那么Bean只在一个地方注入，修改属性就好，名字能一样吗？一系列问题<br>这个StepScope是什么鬼，5个默认的Scope能满足需求吗？<br>
        
          <p class="article-more-link">
            <a href="/2018/01/12/spring-bean-scope/#more">Read More</a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://blog.520wa.com/2018/01/12/spring-bean-scope/" data-id="ckcqflawh000zeodem96pvgxl" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Bean/">Bean</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Qualifier/">Qualifier</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Spring/">Spring</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/SpringBatch/">SpringBatch</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/StepScope/">StepScope</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/scope/">scope</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-versionCode-not-exist-in-manifest" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2018/01/09/versionCode-not-exist-in-manifest/" class="article-date">
  <time datetime="2018-01-09T05:49:39.000Z" itemprop="datePublished">2018-01-09</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Android/">Android</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2018/01/09/versionCode-not-exist-in-manifest/">Manifest中找不到versionCode?</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h4 id="起因"><a href="#起因" class="headerlink" title="起因"></a>起因</h4><p>17年做的update（升级平台）交由其它团队维护后，发现解析Manifest后未找到versionCode、versionName信息。<br>大家都讲终极绝招，使用aapt来获取，但是这样耦合低，并且得在服务器上维护Android环境，显然不合理。所以要干他<br>此文都是解决思路，心急直接看最后的结论</p>
<h4 id="环境"><a href="#环境" class="headerlink" title="环境"></a>环境</h4><ul>
<li>Android Studio 3.0</li>
<li>Gradle 4.1</li>
<li>targetSdkVersion 26 minSdkVersion 8</li>
<li>apktool 2.3.1</li>
<li>AXMLPrinter2</li>
<li>APKParser</li>
</ul>
        
          <p class="article-more-link">
            <a href="/2018/01/09/versionCode-not-exist-in-manifest/#more">Read More</a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://blog.520wa.com/2018/01/09/versionCode-not-exist-in-manifest/" data-id="ckcqflawp0017eode6nranqw8" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/APKParser/">APKParser</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/AXMLPrinter2/">AXMLPrinter2</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/manifest/">manifest</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/versionCode/">versionCode</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-date-formate-YYYY-in-java" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2018/01/03/date-formate-YYYY-in-java/" class="article-date">
  <time datetime="2018-01-03T05:58:38.000Z" itemprop="datePublished">2018-01-03</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java/">Java</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2018/01/03/date-formate-YYYY-in-java/">日期格式化 YYYY日期错位</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h4 id="起因"><a href="#起因" class="headerlink" title="起因"></a>起因</h4><p>支付系统通知账务还款结果时，对请求时间使用“YYYYMMddHHmmss”格式化，20171231变为了20181231致使数据不匹配。  </p>
<p>我们大多都知道mm与MM的区别，因为分和月会同时出现，但很少会关注其它的pattern大小写有无区分。<br>
        
          <p class="article-more-link">
            <a href="/2018/01/03/date-formate-YYYY-in-java/#more">Read More</a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://blog.520wa.com/2018/01/03/date-formate-YYYY-in-java/" data-id="ckcqflaw2000keodetydvst2z" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/DateFormat/">DateFormat</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/YYYY/">YYYY</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/iOS/">iOS</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/yyyy/">yyyy</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-WebView-can-not-support-WebGL" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2017/12/18/WebView-can-not-support-WebGL/" class="article-date">
  <time datetime="2017-12-18T08:42:06.000Z" itemprop="datePublished">2017-12-18</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Android/">Android</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2017/12/18/WebView-can-not-support-WebGL/">WebView兼容问题之can not support WebGL</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p><a href="https://youjie.kongapi.com/?channel=xiangduoduoylpyj&amp;utm_source=daikuan&amp;utm_medium=xiangduoduoylpyj#/loan-in-index" target="_blank" rel="noopener">合作方页面</a>能在浏览器中打开，不能在我们的WebView中打开，运营打上门来。<br>作为一个有态度的码农当然是要怒回去的。于是调试看了对方h5报错如下：<br>
        
          <p class="article-more-link">
            <a href="/2017/12/18/WebView-can-not-support-WebGL/#more">Read More</a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://blog.520wa.com/2017/12/18/WebView-can-not-support-WebGL/" data-id="ckcqflavh0006eodemvvk0x6c" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/WEBGL-debug-renderer-info/">WEBGL_debug_renderer_info</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/WebGL/">WebGL</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/WebView/">WebView</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/chrome/">chrome</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/experimental-webgl/">experimental-webgl</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/v36/">v36</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/兼容问题/">兼容问题</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-WebView-RestoreInstance-onActivityForResult-not-work" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2017/12/15/WebView-RestoreInstance-onActivityForResult-not-work/" class="article-date">
  <time datetime="2017-12-15T11:41:34.000Z" itemprop="datePublished">2017-12-15</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Android/">Android</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2017/12/15/WebView-RestoreInstance-onActivityForResult-not-work/">Activity调用外部为WebView设值不成功问题解决</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>简单的Android保存恢复数据，有很多app没有做到。如之前提到的知名APP<a href="https://juejin.im/" target="_blank" rel="noopener">掘金v3.1.1</a>，以及朋友公司的<a href="http://www.sxyj.net/" target="_blank" rel="noopener">书香云集v5.40.1</a>，基本每去一家公司都会要为公司产品检查修改此类问题。本以为自己是这方面的老司机，没想到最近同事反馈上来又有此类问题发生，而这次的问题却是与我有关。<br>16年9月开始负责重构马上金融2.0，其中一项重要功能是hybrid资料表单以适应风控频繁变化的需求。采用jsbridge动态写入js解决js与native相互调用的安全性，此次按下不表。<font color="red"><strong>问题发生在表单中js调用android访问联系人，获取联系人数据调用js设置时不成功</strong></font>  </p>
<h5 id="原因"><a href="#原因" class="headerlink" title="原因"></a>原因</h5><p>还原代码<br>MainActivity  implements RestoreActivityResultCallback<br>
        
          <p class="article-more-link">
            <a href="/2017/12/15/WebView-RestoreInstance-onActivityForResult-not-work/#more">Read More</a>
          </p>
        
      
    </div>
    <footer class="article-footer">
      <a data-url="https://blog.520wa.com/2017/12/15/WebView-RestoreInstance-onActivityForResult-not-work/" data-id="ckcqflavj0007eodegq1qj19r" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Activity/">Activity</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/RestoreInstance/">RestoreInstance</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/WebView/">WebView</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/onActivityForResult/">onActivityForResult</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/onPageFinished/">onPageFinished</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-fix-301-redirect" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2017/12/07/fix-301-redirect/" class="article-date">
  <time datetime="2017-12-07T15:04:55.000Z" itemprop="datePublished">2017-12-07</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Java/">Java</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2017/12/07/fix-301-redirect/">301重定向导致不能正常访问</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>事件通报中称由于挂维护跳转301后，恢复服务，app WebView访问缓存仍然停留在公司官方网页，无法正确访问。<br>参考<a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" target="_blank" rel="noopener">Http Status Code Definitions</a><br>究其原因可以知道默认情况下大家都必须遵守规范，才能不乱，并在这套规则中永久玩下去。<br>如果遇到类似情况，直接分析请求头</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://blog.520wa.com/2017/12/07/fix-301-redirect/" data-id="ckcqflaw5000neode2guvh2gs" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/301/">301</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/302/">302</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Http-Status-Code/">Http Status Code</a></li></ul>

    </footer>
  </div>
  
</article>


  
  
    <nav id="page-nav">
      <a class="extend prev" rel="prev" href="/page/2/">&laquo; Prev</a><a class="page-number" href="/">1</a><a class="page-number" href="/page/2/">2</a><span class="page-number current">3</span><a class="page-number" href="/page/4/">4</a><a class="page-number" href="/page/5/">5</a><a class="extend next" rel="next" href="/page/4/">Next &raquo;</a>
    </nav>
  
</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Android/">Android</a><span class="category-list-count">15</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/C/">C++</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Java/">Java</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/NDK-Samples/">NDK Samples</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Web/">Web</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/其它/">其它</a><span class="category-list-count">13</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/前端/">前端</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/数据/">数据</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/统计学/">统计学</a><span class="category-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/02-00-00-00-00-00/" style="font-size: 10px;">02:00:00:00:00:00</a> <a href="/tags/301/" style="font-size: 10px;">301</a> <a href="/tags/302/" style="font-size: 10px;">302</a> <a href="/tags/APKParser/" style="font-size: 10px;">APKParser</a> <a href="/tags/AXMLPrinter2/" style="font-size: 10px;">AXMLPrinter2</a> <a href="/tags/Activity/" style="font-size: 10px;">Activity</a> <a href="/tags/Android-TV/" style="font-size: 10px;">Android TV</a> <a href="/tags/AndroidStudio/" style="font-size: 10px;">AndroidStudio</a> <a href="/tags/Arithmetic/" style="font-size: 10px;">Arithmetic</a> <a href="/tags/AutoService/" style="font-size: 10px;">AutoService</a> <a href="/tags/Bean/" style="font-size: 10px;">Bean</a> <a href="/tags/Butterknife/" style="font-size: 10px;">Butterknife</a> <a href="/tags/C/" style="font-size: 10px;">C++</a> <a href="/tags/Content-Type/" style="font-size: 10px;">Content-Type</a> <a href="/tags/DataBinding/" style="font-size: 10px;">DataBinding</a> <a href="/tags/DateFormat/" style="font-size: 10px;">DateFormat</a> <a href="/tags/Debugger/" style="font-size: 10px;">Debugger</a> <a href="/tags/DownloadManager/" style="font-size: 10px;">DownloadManager</a> <a href="/tags/Excel/" style="font-size: 10px;">Excel</a> <a href="/tags/FeignClient/" style="font-size: 10px;">FeignClient</a> <a href="/tags/FormEncoder/" style="font-size: 10px;">FormEncoder</a> <a href="/tags/Gradle/" style="font-size: 20px;">Gradle</a> <a href="/tags/Gson-serialization-deserialization-enum/" style="font-size: 10px;">Gson serialization/deserialization enum</a> <a href="/tags/Gson反序列化枚举/" style="font-size: 10px;">Gson反序列化枚举</a> <a href="/tags/Gson序列化枚举/" style="font-size: 10px;">Gson序列化枚举</a> <a href="/tags/How-compress/" style="font-size: 10px;">How compress</a> <a href="/tags/Http-Status-Code/" style="font-size: 10px;">Http Status Code</a> <a href="/tags/HttpClient/" style="font-size: 10px;">HttpClient</a> <a href="/tags/Huffman/" style="font-size: 10px;">Huffman</a> <a href="/tags/JNI/" style="font-size: 10px;">JNI</a> <a href="/tags/Java数据分析房价/" style="font-size: 10px;">Java数据分析房价</a> <a href="/tags/Jenkins/" style="font-size: 10px;">Jenkins</a> <a href="/tags/JitPack/" style="font-size: 10px;">JitPack</a> <a href="/tags/JsonDeserializer/" style="font-size: 10px;">JsonDeserializer</a> <a href="/tags/JsonSerializer/" style="font-size: 10px;">JsonSerializer</a> <a href="/tags/Mock/" style="font-size: 10px;">Mock</a> <a href="/tags/NODE-ENV/" style="font-size: 10px;">NODE_ENV</a> <a href="/tags/Native/" style="font-size: 10px;">Native</a> <a href="/tags/NetworkInterface/" style="font-size: 10px;">NetworkInterface</a> <a href="/tags/NullPointException/" style="font-size: 10px;">NullPointException</a> <a href="/tags/OSS/" style="font-size: 10px;">OSS</a> <a href="/tags/Qualifier/" style="font-size: 10px;">Qualifier</a> <a href="/tags/RestTemplate/" style="font-size: 10px;">RestTemplate</a> <a href="/tags/RestoreInstance/" style="font-size: 10px;">RestoreInstance</a> <a href="/tags/SDK/" style="font-size: 10px;">SDK</a> <a href="/tags/SDK更新给开发者/" style="font-size: 10px;">SDK更新给开发者</a> <a href="/tags/SimpleDateFormat/" style="font-size: 10px;">SimpleDateFormat</a> <a href="/tags/Spring/" style="font-size: 15px;">Spring</a> <a href="/tags/SpringBatch/" style="font-size: 10px;">SpringBatch</a> <a href="/tags/StepScope/" style="font-size: 10px;">StepScope</a> <a href="/tags/Time-Zone/" style="font-size: 10px;">Time Zone</a> <a href="/tags/TingPNG/" style="font-size: 10px;">TingPNG</a> <a href="/tags/TransformException/" style="font-size: 10px;">TransformException</a> <a href="/tags/WEBGL-debug-renderer-info/" style="font-size: 10px;">WEBGL_debug_renderer_info</a> <a href="/tags/WIFI/" style="font-size: 10px;">WIFI</a> <a href="/tags/WebGL/" style="font-size: 10px;">WebGL</a> <a href="/tags/WebView/" style="font-size: 15px;">WebView</a> <a href="/tags/WebView水印/" style="font-size: 10px;">WebView水印</a> <a href="/tags/WifiInfo/" style="font-size: 10px;">WifiInfo</a> <a href="/tags/YYYY/" style="font-size: 10px;">YYYY</a> <a href="/tags/object-Object/" style="font-size: 15px;">[object Object]</a> <a href="/tags/annotationProcessor/" style="font-size: 10px;">annotationProcessor</a> <a href="/tags/antd-init/" style="font-size: 10px;">antd-init</a> <a href="/tags/applicaton/" style="font-size: 10px;">applicaton</a> <a href="/tags/brew/" style="font-size: 10px;">brew</a> <a href="/tags/chrome/" style="font-size: 10px;">chrome</a> <a href="/tags/crash/" style="font-size: 10px;">crash</a> <a href="/tags/create-umi/" style="font-size: 10px;">create-umi</a> <a href="/tags/cross-env/" style="font-size: 10px;">cross-env</a> <a href="/tags/dependencies/" style="font-size: 10px;">dependencies</a> <a href="/tags/dummy0/" style="font-size: 10px;">dummy0</a> <a href="/tags/duplicate-entry/" style="font-size: 10px;">duplicate entry</a> <a href="/tags/experimental-webgl/" style="font-size: 10px;">experimental-webgl</a> <a href="/tags/feign-form/" style="font-size: 10px;">feign-form</a> <a href="/tags/fit/" style="font-size: 10px;">fit</a> <a href="/tags/flavor/" style="font-size: 10px;">flavor</a> <a href="/tags/github-api/" style="font-size: 10px;">github api</a> <a href="/tags/iOS/" style="font-size: 15px;">iOS</a> <a href="/tags/image-jpeg/" style="font-size: 10px;">image/jpeg</a> <a href="/tags/install/" style="font-size: 10px;">install</a> <a href="/tags/ipv4/" style="font-size: 10px;">ipv4</a> <a href="/tags/ipv6/" style="font-size: 10px;">ipv6</a> <a href="/tags/jpeg/" style="font-size: 10px;">jpeg</a> <a href="/tags/libjpeg/" style="font-size: 10px;">libjpeg</a> <a href="/tags/libjpeg-turbo/" style="font-size: 10px;">libjpeg-turbo</a> <a href="/tags/mac/" style="font-size: 10px;">mac</a> <a href="/tags/manifest/" style="font-size: 10px;">manifest</a> <a href="/tags/mockjs/" style="font-size: 10px;">mockjs</a> <a href="/tags/module/" style="font-size: 10px;">module</a> <a href="/tags/ndk-camera/" style="font-size: 10px;">ndk camera</a> <a href="/tags/onActivityForResult/" style="font-size: 10px;">onActivityForResult</a> <a href="/tags/onPageFinished/" style="font-size: 10px;">onPageFinished</a> <a href="/tags/registerTypeAdapter/" style="font-size: 10px;">registerTypeAdapter</a> <a href="/tags/scope/" style="font-size: 10px;">scope</a> <a href="/tags/spawn/" style="font-size: 10px;">spawn</a> <a href="/tags/storage/" style="font-size: 10px;">storage</a> <a href="/tags/transformClassesWithJarMerging/" style="font-size: 10px;">transformClassesWithJarMerging</a> <a href="/tags/v36/" style="font-size: 10px;">v36</a> <a href="/tags/versionCode/" style="font-size: 10px;">versionCode</a> <a href="/tags/vue/" style="font-size: 10px;">vue</a> <a href="/tags/watermark/" style="font-size: 10px;">watermark</a> <a href="/tags/wlan0/" style="font-size: 10px;">wlan0</a> <a href="/tags/yyyy/" style="font-size: 10px;">yyyy</a> <a href="/tags/下载图片/" style="font-size: 10px;">下载图片</a> <a href="/tags/中位数/" style="font-size: 10px;">中位数</a> <a href="/tags/中程数/" style="font-size: 10px;">中程数</a> <a href="/tags/主动push/" style="font-size: 10px;">主动push</a> <a href="/tags/人脸支付/" style="font-size: 15px;">人脸支付</a> <a href="/tags/人脸比对效率/" style="font-size: 10px;">人脸比对效率</a> <a href="/tags/众数/" style="font-size: 10px;">众数</a> <a href="/tags/兼容问题/" style="font-size: 10px;">兼容问题</a> <a href="/tags/同步支付/" style="font-size: 10px;">同步支付</a> <a href="/tags/命名空间/" style="font-size: 10px;">命名空间</a> <a href="/tags/图片链接/" style="font-size: 10px;">图片链接</a> <a href="/tags/均值/" style="font-size: 10px;">均值</a> <a href="/tags/多形参/" style="font-size: 10px;">多形参</a> <a href="/tags/头文件/" style="font-size: 10px;">头文件</a> <a href="/tags/如何主动PUSH/" style="font-size: 10px;">如何主动PUSH</a> <a href="/tags/异步支付/" style="font-size: 10px;">异步支付</a> <a href="/tags/引流/" style="font-size: 10px;">引流</a> <a href="/tags/支付/" style="font-size: 10px;">支付</a> <a href="/tags/数据决策/" style="font-size: 10px;">数据决策</a> <a href="/tags/数据分析/" style="font-size: 10px;">数据分析</a> <a href="/tags/春运交通情况/" style="font-size: 10px;">春运交通情况</a> <a href="/tags/智能硬件/" style="font-size: 10px;">智能硬件</a> <a href="/tags/权限/" style="font-size: 10px;">权限</a> <a href="/tags/极差/" style="font-size: 10px;">极差</a> <a href="/tags/构造函数/" style="font-size: 10px;">构造函数</a> <a href="/tags/模板/" style="font-size: 10px;">模板</a> <a href="/tags/水印/" style="font-size: 10px;">水印</a> <a href="/tags/浏览器显示图片/" style="font-size: 10px;">浏览器显示图片</a> <a href="/tags/用户体验/" style="font-size: 10px;">用户体验</a> <a href="/tags/网页水印/" style="font-size: 10px;">网页水印</a> <a href="/tags/脸部特征计算/" style="font-size: 10px;">脸部特征计算</a> <a href="/tags/蓝牙/" style="font-size: 10px;">蓝牙</a> <a href="/tags/蜻蜓/" style="font-size: 10px;">蜻蜓</a> <a href="/tags/重载默认参数函数/" style="font-size: 10px;">重载默认参数函数</a> <a href="/tags/阿里云显示图片/" style="font-size: 10px;">阿里云显示图片</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/07/">July 2020</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/04/">April 2020</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/01/">January 2020</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/11/">November 2019</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/09/">September 2019</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/05/">May 2019</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">April 2019</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/">March 2019</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/02/">February 2019</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/01/">January 2019</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/12/">December 2018</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/11/">November 2018</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/09/">September 2018</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/02/">February 2018</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/01/">January 2018</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/12/">December 2017</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/06/">June 2017</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/05/">May 2017</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/04/">April 2017</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/03/">March 2017</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/05/">May 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/03/">March 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/02/">February 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/01/">January 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/12/">December 2015</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/11/">November 2015</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/10/">October 2015</a><span class="archive-list-count">3</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recents</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2020/07/17/browser-view-or-download-image-by-header/">浏览器打开图片链接时直接显示或下载到底怎么回事</a>
          </li>
        
          <li>
            <a href="/2020/04/19/watermark-by-android/">Android中添加背景水印，含WebView</a>
          </li>
        
          <li>
            <a href="/2020/04/08/use_mockjs_vue/">VUE中使用Mock模拟数据请求</a>
          </li>
        
          <li>
            <a href="/2020/04/04/annotation-proccor-by-gradle4-7/">annotationProcessor 引用后编译时不生效问题</a>
          </li>
        
          <li>
            <a href="/2020/01/08/enum-serializer-by-Gson/">Gson序列化、反序列化枚举</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2020 Tu<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
    <a href="/about" class="mobile-nav-link">About</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>

  </div>
</body>
</html>